importPackage(net.sf.odinms.net.channel);
importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.tools);
importPackage(net.sf.odinms.server.maps);

var minutes = 1;
var clockminutes = (minutes * 60);
var timerminutes = (clockminutes * 1000);

var status = -1;

function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
        	cm.dispose();
	} else {
        	if (mode == 1) {
            		status++;
		} else {
            		status--;
        	}
        	if (status == 0) {
			cm.sendSimple("What do you want to do?\r\n#L1##bI want to go to the carnival field#l\r\n#L2#I want to leave this place#k#l");
		} else if (status == 1) {
			if (selection == 1) {
				cm.warpParty(cm.getChar().getMapId() + 1);
				cm.startTimer(980000000, timerminutes);
cm.getChar().getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(clockminutes));
				cm.dispose();
			} else if (selection == 2) {
				cm.warp(980000000);
				cm.dispose();
			}
		} else {
			cm.dispose();
		}
	}
}